Imports AesLib
Imports System.Security.Cryptography
Public Class clsSecurity
    Private ASCII As New System.Text.ASCIIEncoding
    Private SHA1 As New SHA1Managed
    Private SHA1Password() As Byte
    Private AESKey() As Byte
    Public Sub New()

    End Sub
    Public Function CalcHash(ByVal data As String, _
        Optional ByVal password As Boolean = False)
        Dim hash As String, buffer() As Byte
        buffer = SHA1.ComputeHash(ASCII.GetBytes(data))
        For Each bit As Byte In buffer
            If bit < 16 Then
                hash += "0"
            End If
            hash += Hex(bit).ToString
        Next
        If password Then
            SHA1Password = ASCII.GetBytes(hash.ToLower)
        End If
        CalcHash = hash.ToLower
    End Function
    Public Function Encrypt(ByVal data As String)

    End Function
    Public Function Decrypt(ByVal data As String)

    End Function
End Class
